<?php // no direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.path');
$Itemid = JRequest::getVar( 'Itemid', 0, 'get', 'int' );
JHTML::stylesheet('base.css', JURI::root().'components/com_simplelisting/css/');
JHTML::stylesheet('listing.css', JURI::root().'/components/com_simplelisting/css/themes/'.$this->select_theme.'/');
$doc =& JFactory::getDocument();
$doc->addScriptDeclaration("
        var RecaptchaOptions = {
        theme : '$this->select_captcha_theme'
        };
");
?>

<div id="listing_details"><!-- Start main container div-->
    <div id="listing_details_inner"><!-- Start inner div -->
        <div class="header"><!-- Start header container -->
           <table class="general_details">
                <tbody>
                   <tr>
                       <td class="cw_title_main">
                            <?php echo $this->author->name, $this->author->create_by; ?>
                       </td>
                   </tr>

                </tbody>
           </table>
                                        <span id="cw_back_button_top">
            <input type="button" onClick="history.go(-1);return false;" value="<?php echo JText::_('BT_BACK'); ?>" class="button">
            </span>
        </div><!-- End header container -->
           <div style="width:100%; height:10px;"></div>
<table class="cw_listing">
    <thead>
    <tr>
        <th width="5%"><?php echo JText::_('LABEL_REF') ?></th>
        <th width="30%" ><?php echo JText::_('LABEL_NAME') ?></th>
        <th width="15%"><?php echo JText::_('LABEL_CATEGORY') ?></th>
        <th width="15%"><?php echo JText::_('LABEL_TYPE') ?></th>
        <th width="15%"><?php echo JText::_('LABEL_POSTED_DATE') ?></th>
    </tr>
    </thead>
    <tbody>

    <?php
     $user =& JFactory::getUser();


                $k = 0;
                    for ($i=0, $n=count( $this->items ); $i < $n; $i++)
                    {
                    $row = &$this->items[$i];
        $link  = JRoute::_( 'index.php?option=com_simplelisting&task=show&cid[]='.$this->escape($row->sid));

       ?>
       <tr class="<?php echo "row$k"; ?>">
       <?php
        echo "<td>".$this->escape($row->sid)."</td>";
        echo "<td><a href=".$link.">".$this->escape($row->listingname)."</a></td>";
        echo "<td>".$this->escape($row->catname)."</td>";
        echo "<td>".$this->escape($row->tidname)."</td>";
        echo "<td>".JHTML::_('date',  $row->posted,  JText::_('DATE_FORMAT_LC4') )."</td>";

       ?>
           
       </tr>
       <?php
		$k = 1 - $k;
        }

	?>
       </tbody>
</table>

<?php if ( $this->params->get( 'show_contact_container' ) ) : ?>
   <table class="general_fields">
       <tbody>
            <tr>
                <td class="cw_title_extras">
                    <?php echo JText::_('FT_AUTHOR_DETAILS')?>
                </td>
            </tr>
            <tr>
                <td colspan="6" class="cw_title_separator"></td>
            </tr>
            <tr>
                <td>
                    <?php if ( $this->params->get( 'show_contact_form' ) ) : ?>
                    <div class="tools_contact_form"><!-- Start contact form container -->
                        <form action="" method="post" enctype="application/x-www-form-urlencoded">
                            <table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
                                <tbody>
                                    <tr>
                                        <td height="30">
                                        <label id="namemsg" for="name"><?php echo JText::_('LABEL_CONTACT_FORM_NAME').': '?></label>
                                        <input type="text" name="name" id="name" value="<?php echo $this->escape(JRequest::getVar('name', '')) ?>" size="30" class="inputbox" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td height="30">
                                        <label id="emailmsg" for="email"><?php echo JText::_('LABEL_CONTACT_FORM_EMAIL').': '?></label>
                                        <input type="text" name="email" id="email" value="<?php echo $this->escape(JRequest::getVar('email', '')) ?>" maxlength="100"  class="inputbox" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td height="30">
                                        <label id="textmsg" for="text"><?php echo JText::_('LABEL_CONTACT_FORM_MESSAGE').': '?></label>
                                        <textarea name="e_message" id="e_message" rows="5" cols="30"  class="inputbox"><?php echo $this->escape(JRequest::getVar('e_message', '')) ?></textarea>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"></td>
                                    </tr>
                                </tbody>
                            </table>
                        <input type="hidden" name="subject" id="subject" value="<?php echo JText::_('EMAIL_AUTHOR').' : '?> <?php echo $this->author->username , JText::_( 'EMAIL_WEBSITE' ) ; ?>" size="30"  class="inputbox" />
                        <input type="hidden" name="create_by" value="<?php echo $this->author->username ?>" />
                        <input type="hidden" name="task" value="sendmailAuthor"/>
                        <input type="hidden" name="option" value="<?php echo JRequest::getVar( 'option' );?>"/>
                        <input type="hidden" name="id" value="<?php echo $this->author->id; ?>"/>  <br />
                        <?php echo JHTML::_('form.token'); ?>
                            <?php
				global $mainframe;
				$mainframe->triggerEvent('onCaptchaDisplay');
                            ?>
                        <br />
                        <input type="submit" value="<?php echo JText::_('BT_SEND') ?>" class="button" />
                    </form>
                </div><!-- End contact form container -->
                <?php endif; ?>
                <?php if ( $this->params->get( 'show_contact_details' ) ) : ?>
                <div class="tools_contact"><!-- Start contact info container -->
                    <table width="100%">
                        <tbody>
                            <tr>
                                <td>
                                    <br />
                                    <?php if ( $this->params->get( 'show_cont_name_detail' ) ) : ?>
                                        <div class="tools_contact_icon">
                                            <img style="margin-right:5px;" align="left" src="<?php echo JURI::root().'components/com_simplelisting/images/notebook-24.png'; ?>" width="24" height="24" alt="Contact">
                                            <?php echo $this->escape( $this->author->username); ?>
                                        </div>
                                    <?php endif; ?>

                                    <?php if ( $this->params->get( 'show_cont_ph_detail' ) ) : ?>
                                        <?php if ( !empty($this->author->tel) ) { ?>
                                            <div class="tools_contact_icon">
                                                <img style="margin-right:5px;" align="left" src="<?php echo JURI::root().'components/com_simplelisting/images/telephone-24.png'; ?>" width="24" height="24" alt="Telephone">
                                                <?php echo $this->escape( $this->author->tel); ?>
                                            </div>
                                        <?php } ?>
                                    <?php endif; ?>

                                    <?php if ( $this->params->get( 'show_cont_mob_detail' ) ) : ?>
                                        <?php if ( !empty($this->author->mobile) ) { ?>
                                            <div class="tools_contact_icon">
                                                <img style="margin-right:5px;" align="left" src="<?php echo JURI::root().'components/com_simplelisting/images/mobile-24.png'; ?>" width="24" height="24" alt="Mobile">
                                                <?php echo $this->escape( $this->author->mobile); ?>
                                            </div>
                                        <?php } ?>
                                    <?php endif; ?>

                                    <?php if ( $this->params->get( 'show_cont_fax_detail' ) ) : ?>
                                        <?php if ( !empty($this->author->fax) ) { ?>
                                            <div class="tools_contact_icon">
                                                <img style="margin-right:5px;" align="left" src="<?php echo JURI::root().'components/com_simplelisting/images/printer-24.png'; ?>" width="24" height="24" alt="Fax">
                                                <?php echo $this->escape( $this->author->fax); ?>
                                            </div>
                                        <?php } ?>
                                    <?php endif; ?>

                                    <?php if ( $this->params->get( 'show_cont_email_detail' ) ) : ?>
                                            <div class="tools_contact_icon">
                                                <img style="margin-right:5px;" align="left" src="<?php echo JURI::root().'components/com_simplelisting/images/mail-24.png'; ?>" width="24" height="24" alt="Email">
                                                <?php echo $this->escape( $this->author->email); ?>
                                            </div>
                                    <?php endif; ?>

                                    <?php if ( $this->params->get( 'show_cont_country_detail' ) ) : ?>
                                        <?php if ( !empty($this->author->usercountry) ) { ?>
                                            <div class="tools_contact_icon">
                                                <img style="margin-right:5px;" align="left" src="<?php echo JURI::root().'components/com_simplelisting/images/flag-24.png'; ?>" width="24" height="24" alt="Email">
                                                <?php echo $this->escape( $this->author->usercountry); ?>
                                            </div>
                                        <?php } ?>
                                    <?php endif; ?>

                                    <?php if ( $this->params->get( 'show_cont_misc_detail' ) ) : ?>
                                        <?php if ( !empty($this->author->misc) ) { ?>
                                            <div class="tools_contact_misc">
                                                <?php echo $this->escape( $this->author->misc); ?>
                                            </div>
                                        <?php } ?>
                                    <?php endif; ?>
                                    <br />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div><!-- End contact info container -->
               <?php endif; ?>
            </td>
        </tr>
    </tbody>
</table>
   <?php endif; ?>
   <input type="hidden" name="option" value="com_simplelisting" />
    <input type="hidden" name="view" value="author" />
            <?php if ( $this->params->get( 'show_poweredby' ) ) : ?>
                <div class="cw_powerbyfront">
                    <span class="cw_powerbyfront"><?php echo JTEXT::_('POWEREDBY_MSG'); ?> <a href="http://www.celtaweb.com" target="_blank" title="CeltaWeb">CeltaWeb</a> </span>
                </div>
            <?php endif ?>
    </div><!-- listing_details_inner-->
</div><!-- listing_details-->
